@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion

REM 应用名称
set APP_NAME=boot

REM 获取应用的目录
set SCRIPT_DIR=%~dp0
set APP_HOME=%SCRIPT_DIR:~0,-5%

cd /d %APP_HOME%

REM 停止应用
echo Stopping %APP_NAME%...
for /f "tokens=1" %%i in ('jps -l ^| findstr io.geekidea.boot.SpringBootPlusApplication') do set PID=%%i
if defined PID (
    taskkill /f /pid %PID%
    echo %APP_NAME% stopped successfully!
) else (
    echo %APP_NAME% is not running!
)